package org.geekbang.starter;

import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnNotWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 自定义Configuration 由 {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration} 启用,
 * ,配置 {@link org.springframework.core.io.support.SpringFactoriesLoader#FACTORIES_RESOURCE_LOCATION} 文件,
 * 由 {@link org.springframework.core.io.support.SpringFactoriesLoader#loadFactoryNames(Class, ClassLoader)} 加载
 *
 * @author leo
 * @date 2021/9/15
 * @since 1.0.0
 * @see org.springframework.boot.autoconfigure.EnableAutoConfiguration
 */
@Configuration
@ConditionalOnNotWebApplication
public class CustomerConfiguration {
    @Bean(name = "customApplicationRunner")
    public ApplicationRunner applicationRunner(){
        return (args) -> System.out.println("Hello,World!");
    }
}
